<div class="container">
  <h1>get()</h1>
  <p class="signature">public function get(?string $order_by = null, ?string $target_tbl = null, ?int $limit = null, int $offset = 0): array</p>
  <h2>Description</h2>
  <div class="description">
    <p>
      Retrieves rows from a database table based on optional parameters. This method constructs and executes an SQL query to fetch rows from the specified table, ordering them as specified, with optional limits and offsets.
    </p>
  </div>
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
        <th>Default</th>
        <th>Required</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>order_by</td>
        <td>string|null</td>
        <td>The column to order results by. Default is 'id'.</td>
        <td>'id'</td>
        <td>No</td>
      </tr>
      <tr>
        <td>target_tbl</td>
        <td>string|null</td>
        <td>The name of the database table to query. Default is derived from the first URL segment.</td>
        <td>'First URL segment'</td>
        <td>No</td>
      </tr>
      <tr>
        <td>limit</td>
        <td>int|null</td>
        <td>The maximum number of results to return. Default is null.</td>
        <td>null</td>
        <td>No</td>
      </tr>
      <tr>
        <td>offset</td>
        <td>int</td>
        <td>The number of rows to skip before fetching results. Default is 0.</td>
        <td>0</td>
        <td>No</td>
      </tr>
    </tbody>
  </table>
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>array</td>
        <td>An array of objects representing the fetched rows.</td>
      </tr>
    </tbody>
  </table>
<h2>Example Usage #1</h2>
<p>The code sample below demonstrates how to retrieve all rows from a table.  In this example, the table name is not explicitly passed into the method.  This means that the table name would be assumed to be the value of the first URL segment.</p>
<div class="example">
  <pre>
$rows = $this->model->get();</pre>
</div>

<h2>Example Usage #2</h2>
<p>The code sample below demonstrates how to retrieve rows from a specific table, ordered by 'id' descending.  In this example, the second argument ('orders') indicates the name of the table to be queried.</p>
<div class="example">
  <pre>
$rows = $this->model->get('id desc', 'orders');</pre>
</div>

<h2>Example Usage #3</h2>
<p>The code sample below demonstrates how to retrieve rows from a specific table, named 'products'.    The results, in this instance, would be ordered by 'name' and limited to 10 results, with an offset of 5.</p>
<div class="example">
  <pre>$rows = $this->model->get('name', 'products', 10, 5);</pre>
</div>


</div>
